import request, { post } from '../utils/request';
import axios from 'axios';
let base_url = "http://localhost:80";
// let page1='"a='+data.a+'&b='+data.b+'"';
const instance = axios.create({
    baseURL: 'http://localhost:80/',
    timeout: 3*1000,
    headers: {'X-Custom-Header': 'foobar'}
  });
export const fetch_student = query => {
    console.log("this.query:",query);
    console.log("liuhui");
    return axios.post('api/UserQuery/findbyusername',"name="+query.name+"&a="+query.a+"&b="+query.b,{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
    // return post("/articles/selectall",query);
    // return post("/studentInfo/searchInfo",query);/UserQuery/select
};

export const fetch_grade  = data => {
    
    console.log(data);
    return axios.post('api/articles/name1',"title="+data.title+"&currentPage="+data.currentPage+"&pageSize="+data.pageSize,{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
    // return post("articles/name1",data);
};

export const fetch_grade1  = data => {
    
    // console.log(data);
    return axios.post('api/yijie/select1',{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
    // return post("articles/name1",data);
};

































export const update_student_info = data => {
   
};
export const add_student  = data => {

};
export const update_grade  = data => {
   
};
export const fetch_grade_makeup  = data => {
    console.log(data);
    return axios.post('api/img/name1',"title="+data.title+"&currentPage="+data.currentPage+"&pageSize="+data.pageSize,{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
};
export const update_grade_makeup  = data => {
    console.log(data);
    return axios.post('api/articles/insertbyid',"id="+data.id,{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
};
export const update_grade_makeup1  = data => {
    console.log(data);
    return axios.post('api/img/deletebyid',"id="+data.id,{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
};

export const fetch_data_with_credit  = data => {

    console.log("this.query:",data);
      return axios.post('api/news/selectall',"name="+data.name+"&a="+data.a+"&b="+data.b,{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
};


export const shuliang  = data => {
    return axios.post('api/news/num',{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
};

export const shuliang1  = data => {
    return axios.post('api/comment/num',{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
};


export const update_status  = data => {
    
};
export const fetch_major  = data => {

   
    
};
export const fetch_log  = data => {
    console.log("this.query:",data);
    return axios.post('api/comment/selectall',"name="+data.name+"&a="+data.a+"&b="+data.b,{
        headers:{
           'content-type': 'application/x-www-form-urlencoded',
        }
    });
};